#!/usr/bin/python

if __name__ == '__main__':
    import os
    import sys
    import subprocess
    from pop_msg import POP_MSG

def main( cmd ):
    #cmd = ['g++', '-o', 'virtual', 'virtual.cpp']
    proc = subprocess.Popen( cmd, stderr=subprocess.PIPE )
    if 0!=proc.wait():
        out = proc.stderr.readlines()
        msg = ''
        for line in out:
            msg += line
        print msg
        POP_MSG( out )
    else:
        POP_MSG( 'Build done, sucessful!' )

    print 'Main process done!'

if __name__ == '__main__':
    main( sys.argv[1:] )
